Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  In C, what is the meaning of following functi... Start Learning for Free
In C, what is the meaning of following function prototype with empty parameter list
void fun()
{
   /* .... */
}
  • a)
    Function can only be called without any parameter
  • b)
    Function can be called with any number of parameters of any types
  • c)
    Function can be called with any number of integer parameters.
  • d)
    Function can be called with one integer parameter
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
In C, what is the meaning of following function prototype with empty p...
Function Prototype with Empty Parameter List in C

In C, a function prototype with an empty parameter list means that the function can be called with any number of parameters of any types. Let's understand this in detail.

Function Prototype

A function prototype is a declaration that specifies the function name and its parameters, without providing the function definition. It gives the compiler information about the function's return type and the number and types of its parameters.

Empty Parameter List

An empty parameter list in a function prototype means that the function does not have any parameters. In C, an empty parameter list is denoted by leaving the parentheses empty, like `void fun()`. This indicates that the function does not require any arguments.

Meaning of an Empty Parameter List

When a function prototype has an empty parameter list, it means that the function can be called with any number of parameters of any types. This is because the function prototype does not specify any specific parameters, allowing flexibility in the number and types of arguments passed to the function.

Examples

Let's consider an example to understand this concept further:

```
#include

void fun();

int main() {
fun(); // Function call without any parameter
fun(10); // Function call with one integer parameter
fun(10, 20); // Function call with two integer parameters
fun(3.14, "Hello"); // Function call with one double and one string parameter

return 0;
}

void fun() {
printf("Function called\n");
}
```

In the above example, the function `fun` is declared with an empty parameter list in the function prototype. This allows the function to be called without any parameters (`fun()`), with one integer parameter (`fun(10)`), with two integer parameters (`fun(10, 20)`), or with any other combination of parameters.

Conclusion

In C, a function prototype with an empty parameter list indicates that the function can be called with any number of parameters of any types. This provides flexibility in the function call, allowing for different combinations of arguments to be passed to the function.
Free Test
Community Answer
In C, what is the meaning of following function prototype with empty p...
Empty list in C mean that the parameter list is not specified and function can be called with any parameters. In C, to declare a function that can only be called without any parameter, we should use "void fun(void)" As a side note, in C++, empty list means function can only be called without any parameter. In C++, both void fun() and void fun(void) are same.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer?
Question Description
In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer?.
Solutions for In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice In C, what is the meaning of following function prototype with empty parameter listvoid fun(){ /* .... */}a)Function can only be called without any parameterb)Function can be called with any number of parameters of any typesc)Function can be called with any number of integer parameters.d)Function can be called with one integer parameterCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev